﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection.Emit;
using System.Text;
using YAPL.Language.Ast;
using YAPL.Language.Compiler.CodeGen.ReflectionEmitGenerator.AstGen.Helpers;

namespace YAPL.Language.Compiler.CodeGen.ReflectionEmitGenerator.AstGen {
	public class ReClassReferenceGenerator : ReExpressionGenerator {
		public ReClassReferenceGenerator(ReCodeGenerator generator) : base(generator) {}
		public override void Generate(Ast.Expression expr) {
			var classReferenceExpr = (Ast.ClassReferenceExpression) expr;
			var ilGen = Generator.Get<ILGenerator>(ReCodeGenerator.IL_GENERATOR_KEY);
			ilGen.EmitGetClassFromGCL(classReferenceExpr.Name);
		}
	}
}
